<?php
/**
* $Id: tv_object.php 2942 2012-02-20 10:48:18Z huong.pham $
* @desc Class Generic Object
* The generic object support object property getter and setter
* 
* @author Hung Nguyen
*/
class TV_Object
{
    public function __get($name)
    {
        $getter='get'.$name;
        if(method_exists($this,$getter))
        {
            // getting a property
            return $this->$getter();
        }else{
            try{
                return $this->$name;
            }catch(Exception $ex){
                throw $ex;
            }
        }
    }
    
    public function __set($name, $value){
        $setter='set'.$name;
        if(method_exists($this,$setter))
        {
            $this->$setter($value);
        }else{
            try{
                $this->$name = $value;
            }catch(Exception $ex){
                throw $ex;
            }
        }
    }
}
?>
